<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.text.SimpleDateFormat,java.text.DateFormat,java.util.Date"%>
<%@ include file="/WEB-INF/common/taglib.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<meta name="viewport" content="initial-scale=1.0,width=device-width" />
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<link rel="stylesheet" href="${ctx }/static/css/Master.css"/>
	<link rel="stylesheet" href="${ctx }/static/css/lq.datetimepick.css"/>
	<link rel="stylesheet" href="${ctx }/static/css/jquery-labelauty.css"/>
	<script type="text/javascript" src="${ctx }/static/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="${ctx}/static/js/selectUi.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/jsScroller.js"></script>
	<script type="text/javascript" src="${ctx}/static/js/layer.js"></script>
	<script type="text/javascript">
	function upload(){
		var name = $("#myfiles").val();
		if(name == ""){
			$("#redSpan").text("请选择上传文件");
			$("#redSpan").show();
		}else{
			var suffix = name.substring(name.lastIndexOf("."));
			if(".xlsx"==suffix || ".xls"==suffix){
				$("#redSpan").hide();
				$("#importForm").submit();
			}else{
				$("#redSpan").text("导入文件必须为Excel格式");
				$("#redSpan").show();
			}
		}
	}
</script>
  </head>
  
  <body>
  	<form id="importForm" action="${ctx}/community/importExcel" method="post" enctype="multipart/form-data">
	    <input type="file" id="myfiles" name="myfiles" accept=".xls,.xlsx" />
	    <span id="redSpan" style="padding-top: 10px;font-size: 12px;color: red;display: none;"></span>
	    <br/>
	    <input type="button" onclick="upload();" value="上传" />
    </form>
    <span id="redResult" style="padding-top: 10px;font-size: 12px;color: red;display: block;">${result }</span>
  </body>
</html>
